﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<pcceftaw.Models.seg_tb_Usuarios>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Novo Usuário
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Novo Usuário</h2>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>Dados do Usuário</legend>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.tx_nome, "Nome") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.tx_nome) %>
            <%: Html.ValidationMessageFor(model => model.tx_nome) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.tx_login, "Login") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.tx_login) %>
            <%: Html.ValidationMessageFor(model => model.tx_login) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.tx_senha, "Senha") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.tx_senha) %>
            <%: Html.ValidationMessageFor(model => model.tx_senha) %>
        </div>

        <div>
            <legend>Permissões</legend><br />
            <table class="datatable">
                <% foreach (var per in (List<pcceftaw.Models.seg_tb_permissoes>)ViewData["pers"])
                    { %>
                <tr>
                    <td style="text-align:left;">&nbsp;<%: per.tx_descricao%></td>
                    <td><input type="checkbox" id="pers" name="pers" value="<%: per.id_permissao %>" /></td>
                </tr>  
                      
                <% } %>
            </table>
        </div>


        <p>
            <input type="submit" value="Criar" />
        </p>
    </fieldset>
<% } %>

<div>
    <%: Html.ActionLink("Voltar para listagem", "Index") %>
</div>

</asp:Content>
